document.addEventListener('DOMContentLoaded', function() {
    // 时间筛选按钮切换
    const timeFilters = document.querySelectorAll('.time-filter');
    timeFilters.forEach(filter => {
        filter.addEventListener('click', function() {
            timeFilters.forEach(f => f.classList.remove('active'));
            this.classList.add('active');
        });
    });
});
// 下拉选择
$('.select-display').click(function() {
    $('.select-options').toggle();
});
$('.select-option').click(function() {
    const selectedText = $(this).text();
    if (!$(this).hasClass('parent')) {
        $('.child').removeClass('select');
        $(this).addClass('select');
        $('.select-display span:first').text(selectedText);
        $('.select-options').hide();
    }
    $('.child-box').hide();
    $(this).find('.child-box').show();
});


$('.chart-title-sm').click(function() {
    $(this).addClass('select').siblings().removeClass('select');
})